<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<!-- ko if: isActive() || hasActiveOptions() -->
<div class="cart-gift-item">
    <div class="gift-item-block block"
         data-collapsible="true"
         data-bind="css: {_active: formBlockVisibility() || resultBlockVisibility()}">
        <div class="title" data-role="title" data-bind="click: $data.toggleFormBlockVisibility.bind($data)">
            <span data-bind="i18n: 'Gift options'"></span>
        </div>
        <div class="content" data-role="content" data-bind="visible: formBlockVisibility() || resultBlockVisibility()">
            <!-- ko ifnot: resultBlockVisibility() -->
            <div class="gift-options">
                <!-- ko foreach: getRegion('additionalOptions') -->
                    <!-- ko template: getTemplate() --><!-- /ko -->
                <!-- /ko -->
                <!-- ko template: formTemplate --><!--/ko-->
            </div>
            <!-- /ko -->
            <div class="gift-summary">
                <!-- ko if: resultBlockVisibility() -->
                    <!-- ko foreach: getRegion('additionalOptions') -->
                         <!--ko template: appliedTemplate --><!-- /ko -->
                    <!-- /ko -->

                    <!-- ko if: getObservable('message') -->
                        <div class="gift-message-summary">
                            <span data-bind="i18n: 'Message:'"></span>
                            <!-- ko text: getObservable('message') --><!-- /ko -->
                        </div>
                    <!-- /ko -->
                    <div class="actions-toolbar">
                        <div class="secondary">
                            <button type="submit"
                                    class="action action-edit"
                                    data-bind="attr: {title: $t('Edit')}, click: $data.editOptions.bind($data)">
                                <span data-bind="i18n: 'Edit'"></span>
                            </button>
                            <button class="action action-delete"
                                    data-bind="attr: {title: $t('Delete')}, click: $data.deleteOptions.bind($data)">
                                <span data-bind="i18n: 'Delete'"></span>
                            </button>
                        </div>
                    </div>
                <!-- /ko -->
            </div>
        </div>
    </div>
</div>
<!-- /ko -->
